package model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class WorkSharedDB {

	static Connection connection;
	PreparedStatement statement;

	public WorkSharedDB() throws Exception {
		super();
		try {
			if (connection == null || connection.isClosed()) {
				Class.forName("com.mysql.jdbc.Driver");
				connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/workshared", "workshared",
						"workpass");
			}
		} catch (ClassNotFoundException notFoundEx) {
			notFoundEx.printStackTrace();
		} catch (SQLException sqlEx) {
			throw new Exception("Erro ao criar conexão com o banco de dados:" + sqlEx.getMessage());
		}

	}

}
